<?php 
error_reporting(0);
$isadmin=1; 
include '../comm/config.php';
include_once 'include/page.class.php';
include '../comm/checkpostandget.php';
include 'check.php';
$username=$_GET["username"]; 
$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=10;
$page2=($page-1)*$pagesize;

$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die(ERR_DB);
}
else
{
	mysql_query("set names utf8");
	$sql="select * from ".$BIAOTOU."mingxi where ddusername ='".$username."'";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	$total = mysql_num_rows($rs);	
	
	$sql="select * from ".$BIAOTOU."mingxi where ddusername='".$username."' order by id desc limit $page2,$pagesize";
	//mysql_select_db($dbname);
	//echo $sql;
	$rs = mysql_query($sql);

}	
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	color: #FFFFFF;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
.STYLE2 {
	color: #555555;
	font-weight: bold;
	font-size:14px;
	text-decoration:none;
}
-->
</style>
</head>

<body topmargin="5" leftmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="282" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="100%" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td width="440" height="30" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="images/arrow.gif" width="16" height="22" align="absmiddle" /> 用户账户明细管理</strong></td>
              <form id="form1" name="form1" method="get" action="">
              <td width="348" height="30" bgcolor="E9F2FB" class="bigtext">
                <label></label></td> </form>
              <td width="188" align="right" bgcolor="E9F2FB" class="bigtext">共有 <b><?php echo $total;?></b> 条记录&nbsp;&nbsp;</td>
            </tr>
            <tr>
              <td colspan="3" valign="top"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><table width="100%" border=1 cellpadding=0 cellspacing=0
style="border-collapse: collapse" bordercolor="#dddddd">
                  
                    <tr>
                      <td width="4%" height="30" align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;ID</strong></td>
                      <td width="17%" height="30" align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;用户名</strong></td>
					  <td width="17%" align="center"  bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;事件类别</strong></td>
                      <td width="24%" align="center"  bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;事件详细</strong></td>
                      <td width="21%" align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;产生金额</strong></td>                   
                      <td width="17%" align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;发生时间</strong></td>
                    </tr>
					<?php
					while ($row = mysql_fetch_array($rs))
					{
						echo "<tr>";
                      	echo "<td align=center height=30 class=bigtext>&nbsp;".$row["Id"]."</td>";
                      	echo "<td align=center height=30 class=bigtext>&nbsp;".$row["ddusername"]."</td>";
						echo "<td align=center class=bigtext>&nbsp;".$row["shijian"]."</td>";
						echo "<td align=center class=bigtext>&nbsp;".$row["memo"]."</td>";
						echo "<td align=center class=bigtext>&nbsp;".$row["je"]."</td>";
						echo "<td align=center class=bigtext>&nbsp;".$row["addtime"]."</td>";
						echo "</tr>";
					}
					?>
                  </table>
				  <div class="yahoo2" style=" margin-top:30px;"><?php 
				pageft($total,$pagesize,1,1,0,10,"mingxi.php?username=".urlencode($username));
				echo $pagenav;?></div></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
</body>
</html>
<?php mysql_close($link);?>
